package net.llz.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

public class AlipayConfig {
    /**
     * 支付宝网关地址
     */
    public static final  String PAY_GATEWAY="https://openapi.alipaydev.com/gateway.do";

    /**
     * 支付宝 APPID
     */
    public static final  String APPID="2021000121648091";
    /**
     * 应用私钥
     */
    public static final String APP_PRI_KEY="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCui6RX9r6mta6fvLe6UjMiVcobjnSZrPGhA6mpZH1jgxhDX8z9zOGESAFB0c0vqgejMuV3Xc4orCFO9I3Gh56C0WuHJ2NDIfIAjMMkKKtLbxatNgdYrLnD5plaX8mu6x+gx7YGROuIgemSbPgglzKwkMsSb8EUWYu1b8dpeOXmmr37u2Kbw0H02Cmj119E63XwfEft8rxOz1Ie3l2OK+NJSIO/BcxzzCLZ3E8u+3frpNngvpCIPQf8FdHQgVIzwgcan6o2HjhXrU4tKBh3tA73Ezdv7skvtRLtwQtyqnMRSHIgrm/PB2FvOsOadlj/1hBdCJ+Yq8Ua/57to6FDPXhBAgMBAAECggEAb8FW+z8vuHuxD/N7y18gAEbffZ9LRq21k7tNoPiHU/S2z0SCcqoAZnrX2zWiY3dBJpvK0g+MlPwI442vTMK+mdHOQB3W7z/Hu9RkiT1E16qL4WErePo2gpid7YBRGJ7QhFf6Uq9EAwXy7963S96jBOvgKbDF9eqTihrEmeJfiLLSPaZAN3Pwea1vm+K0y3YTwmJ5rs+mi7oPmj8kt/oY8OMr5Qzwc7bG2pTnOYsEQpn/TW/XnKIWfUtX+G7zkHP5Ah5akbBrshOlPa3siVnOFFJekV7lKYE+gGhFF47+krNk9zZsZ5zs2B+4iq/6tFZhq7WSnEUz4NkqudqCZP7FsQKBgQDbLXO8NyMwuEeZkuk/2DEl7RX1EVODZ99L7sMY8aGTAOYKBHoL/wpBWWaM9syH186avc+kFJ4yfABaItuD0hVhokNAKU/xxFEP/WGoySgvZnVfJkMJqlAxvATtR7il5WIqL7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z3uYeDLtI4b2k/RWRT0b1Kv4XEQ+dtk/58vTBAr5o7yu37a/jzJtQI8obT4aAx4fhj/gr4FZ2J2fpS44XLIkzaKkJIgGNDVKoPwHvsgVCXbyTTnAyQIDAQAB";
    /**
     * 签名类型
     */
    public static final  String SIGN_TYPE="RSA2";

    /**
     * 字符编码
     */
    public static final  String CHARSET="UTF-8";

    /**
     * 返回参数格式
     */
    public static final  String FORMAT="json";


    public AlipayConfig() {

    }

   // private volatile static AlipayClient instance = null;

    private volatile static AlipayClient instance = null;
    /**
     * 单例模式获取, 双重锁校验
     * @return
     */
    public static AlipayClient getInstance(){
        if (instance == null){
            synchronized (AlipayConfig.class){
                if (instance == null){
                    instance = new DefaultAlipayClient(PAY_GATEWAY,APPID,APP_PRI_KEY,FORMAT,CHARSET,ALIPAY_PUB_KEY,SIGN_TYPE);
                }
            }
        }
        return instance;
    }

}
